﻿import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls 1.4
import QtQuick.Controls 2.0
import parameter 1.0
Rectangle{
    width: 1280
    height: 800
    color:"cadetblue";
    Rectangle {
        x: 27
        y: 31
        height: 50
        width: 130
        color: "cadetblue"
        border.color: "black"
        border.width: 2
        Text {
            text: "1#锅炉"
            color: "yellow"
            anchors.centerIn: parent
            font.family: "Ubuntu"
            font.pixelSize: 25
        }
        Text{
            x: 458
            y: 11
            text:"用户参数修改记录"
            color:"yellow"
            font.family: "微软雅黑"
            font.pixelSize: 30
        }
        Image {
            id: back
            x: 1138
            y: -23
            width: 50
            height: 50
            source: "qrc:///images/right.png"
        }
        Text {
            x: 1200
            y: 4
            text: "返回"
            color: "black"
            font.family: "Ubuntu"
            font.pixelSize: 20
        }
        Rectangle {
            x: 988
            y: 61
            width: 200
            height: 30
            color: "black"
            Text {
                text: "2017-10-29 15:57:55"
                anchors.centerIn: parent
                color: "yellow"
                font.family: "Ubuntu"
                font.pixelSize: 15
            }
        }
    }
    Rectangle{
        id:record
        x: 8
        y: 210
        width:1264;height:582
        color:"red";
        TableView
            {
                id: tableView
                anchors.fill: parent
                model: theModel
                TableViewColumn
                {
                    id: checkedColumn
                    role: "xuhao"
                    title: qsTr( "序号" )
                    //delegate:styleData.value("1");
                }

                TableViewColumn
                {
                    role: "shijian"
                    title: qsTr( "时间" )
                }
                TableViewColumn
                {
                    role: "caozuoyuan"
                    title: qsTr( "操作员" )
                }
                TableViewColumn
                {
                    role: "so2dixian"
                    title: qsTr( "SO2量程低限" )
                }
                TableViewColumn
                {
                    role: "so2gaoxian"
                    title: qsTr( "SO2量程高限" )
                }
                TableViewColumn
                {
                    role: "noxdixian"
                    title: qsTr( "NOX量程低限" )
                }
                TableViewColumn
                {
                    role: "noxgaoxian"
                    title: qsTr( "NOX量程高限" )
                }
                TableViewColumn
                {
                    role: "kelidixian"
                    title: qsTr( "颗粒物量程低限" )
                }
                TableViewColumn
                {
                    role: "keligaoxian"
                    title: qsTr( "颗粒物量程高限" )
                }
                TableViewColumn
                {
                    role: "o2dixian"
                    title: qsTr( "O2量程低限" )
                }
                TableViewColumn
                {
                    role: "o2gaoxian"
                    title: qsTr( "O2量程高限" )
                }
                TableViewColumn
                {
                    role: "codixian"
                    title: qsTr( "CO量程低限" )
                }
                TableViewColumn
                {
                    role: "cogaoxian"
                    title: qsTr( "CO量程高限" )
                }
            }
    }
    Text{
        x: 27
        y: 139
        text:"记录查询条件，从                            到"
    }
    Rectangle{
        x:174;y:128;
        width:198;height:40
        color:"white"
        TextField
        {
            id:start_date;
            property string dateValue:calendar01.selectedDate;
            property string shortdate:dateValue.substr(0,10);
            x: 0
            y: 0
            width: 198
            height: 40
            text:shortdate;
            Calendar{
                id: calendar01
                x: -32
                anchors.topMargin: 0
                anchors.top: parent.bottom
                visible: false
                activeFocusOnTab: true
                onReleased: {
                    visible = false;
                }
            }

            Button{
                x: 200
                width: 22
                anchors.right: parent.right
                anchors.rightMargin: -22
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 0
                anchors.top: parent.top
                anchors.topMargin: 0
                onClicked: calendar01.visible = true;
            }
        }
    }
    Rectangle{
        x:468;y:128;
        width:198;height:40
        color:"white"
        TextField
        {
            id:end_date;
            property string dateValue:calendar02.selectedDate;
            property string shortdate:dateValue.substr(0,10);
            x: 0
            y: 0
            width: 198
            height: 40
            text:shortdate;
            Calendar{
                id: calendar02
                x: -32
                anchors.topMargin: 0
                anchors.top: parent.bottom
                visible: false
                activeFocusOnTab: true
                onReleased: {
                    visible = false;
                }
            }

            Button{
                x: 200
                width: 22
                anchors.right: parent.right
                anchors.rightMargin: -22
                anchors.bottom: parent.bottom
                anchors.bottomMargin: 0
                anchors.top: parent.top
                anchors.topMargin: 0
                onClicked: calendar02.visible = true;
            }
        }
    }
    Button{
        x: 712
        y: 128
        text:"查询记录"
        onClicked: {
            theModel.setStartTime(start_date.text);
            theModel.setEndTime(end_date.text);
            theModel.update();
        }
    }
}
